home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / windows / mrun211.zip / MRUN211A.WAS < prev    next >
Text File  |  1993-05-01  |  23KB  |  728 lines

  1. ;MailRun v2.11:  Part A, Main body of script
  2. ;1992-1993 Gerald P. Sully, all rights reserved.
  3.  
  4. #comment
  5. **************************************************************************
  6. **************************************************************************
  7. * This file serves as "home base" for the rest of the script.
  8. * All other scripts will return to this one if they are
  9. * exited normally.  It initializes MailRun, creates the
  10. * user interface, and then waits for action on the part of the
  11. * user.  If the user executes a mailrun, this section is also
  12. * responsible for taking care of scheduling.
  13. * Elements of the user interface are contained in the header
  14. * file (MRUN211.H).  Menu selections are fielded by parsemenu()
  15. * and the toolbar is controlled by parseobject().  The routines 
  16. * associated with menu items are contained in the header file 
  17. * immediately following parsemenu() and parseobject().  Some of
  18. * these in turn call routines in other script modules through 
  19. * the callscript() procedure.  Where necessary, a FLAG is set to
  20. * inform the target module which routines to execute.  
  21. * The code for the interface is #included in every module of 
  22. * MailRun so that any part of the script may be called from any 
  23. * other part.  Other script modules are called by MRUN211A and 
  24. * MRUN211G (the module responsible for executing the mailrun) 
  25. * using the "execute" command.  When a module is called from
  26. * MRUN211B-F, a "chain" command is used.
  27. **************************************************************************
  28. **************************************************************************
  29. #endcomment
  30.  
  31. #define MRUN211A
  32. #define MRUN211AG
  33. #define MRUN211AB
  34.  
  35. string MainBoxTabs
  36. integer RingInterrupt, AutoRun
  37. integer MailRunMenu, RunningMenu, FileMenu, ConfigMenu, AddMenu
  38. integer DefaultsMenu, ExecuteMenu, HelpMenu, EditMenu
  39.  
  40. #include "mrun211.h"
  41.  
  42. #define HAVEYOUPAID;YOURFIFTEENDOLLARSYET
  43.  
  44. #comment
  45. *********************************************************************
  46. * MAIN()
  47. * Calls checkchild(), initialize(), maketasklist(),
  48. * makemailrunlist(), runmenu(), mrunmenu(), mrunwin(),
  49. * getfirstitem(), helpabout(), parsedialog(), parsekeystate(),
  50. * interfaceon(), executor(), makefullname()
  51. * Main first calls the initialization routines, then puts
  52. * up the main dialog box and waits for user action.
  53. *********************************************************************
  54. #endcomment
  55.  
  56. proc main
  57. string MRunIcons
  58.     checkchild()
  59.     initialize()
  60.     runmenu()
  61.     mrunmenu()
  62.     mrunwin()
  63.     makemailrunlist()
  64.     maketasklist()
  65.     getfirstitem()
  66.     showmenu MailRunMenu
  67.     if AutoRun == 1
  68.         filereset()
  69.         FLAGS |= RUNNING
  70.         GoWait = 1
  71.         PostRun = 3
  72.         pause 2
  73.     else
  74. #ifdef HAVEYOUPAID;YOURFIFTEENDOLLARSYET
  75.         helpabout()
  76. #else
  77.         mailrunbox()
  78. #endif
  79.     endif
  80.     interfaceon()
  81.     MRunIcons = makefullname(MailRunDir, "MRUNICON.DLL")
  82.     when dialog call parsedialog
  83.     while 1
  84.         if FLAGS & RUNNING
  85.             copyfile MRunIcons "C:\MRUNICON.DLL"
  86.             switch $XPIXELS
  87.                 case 1280
  88.                     iconbutton 1 25 0 "" "C:\MRUNICON.DLL" 16 userwin
  89.                 endcase
  90.                 case 1024
  91.                     iconbutton 1 30 0 "" "C:\MRUNICON.DLL" 16 userwin
  92.                 endcase
  93.                 case 800
  94.                     iconbutton 1 40 0 "" "C:\MRUNICON.DLL" 16 userwin
  95.                 endcase
  96.                 default
  97.                     iconbutton 1 50 0 "" "C:\MRUNICON.DLL" 16 userwin
  98.                 endcase
  99.             endswitch
  100.             paint
  101.             delfile "C:\MRUNICON.DLL"
  102.              showmenu RunningMenu
  103.              executor()
  104.             copyfile MRunIcons "C:\MRUNICON.DLL"
  105.             switch $XPIXELS
  106.                 case 1280
  107.                     iconbutton 1 25 0 "" "C:\MRUNICON.DLL" 0 userwin
  108.                 endcase
  109.                 case 1024
  110.                     iconbutton 1 30 0 "" "C:\MRUNICON.DLL" 0 userwin
  111.                 endcase
  112.                 case 800
  113.                     iconbutton 1 40 0 "" "C:\MRUNICON.DLL" 0 userwin
  114.                 endcase
  115.                 default
  116.                     iconbutton 1 50 0 "" "C:\MRUNICON.DLL" 0 userwin
  117.                 endcase
  118.             endswitch
  119.             paint
  120.             delfile "C:\MRUNICON.DLL"
  121.              showmenu MailRunMenu
  122.         endif
  123.     endwhile
  124. endproc
  125.  
  126.  
  127. #comment
  128. *********************************************************************
  129. * INITIALIZE()
  130. * Called by main()
  131. * Calls cleardir(), makemrn(), makefullname(), checkfile()
  132. * Saves system state and initializes global variables.
  133. *********************************************************************
  134. #endcomment
  135.  
  136. proc initialize
  137. string LastRun, env, temp , CleanupFile
  138. string StateCapPath, StateCapFile, StateDnldPath, StateUpldPath
  139. integer StateAutoDL, StateActionBar, StateMetaKeys
  140. integer blank = 0
  141.     ;Create the working directory
  142.     getenv "TEMP" env
  143.     if NULLSTR env
  144.         TempDir = makefullname($PWTASKPATH, "MRUNTEMP")
  145.     else
  146.         TempDir = makefullname(env, "MRUNTEMP")
  147.     endif
  148.     FLAGS = 0
  149.     MailRunIni = makefullname($WINPATH, "MAILRUN.INI")
  150.     profilerd MailRunIni "MailRun" "MailRun" MailRunTrunc
  151.     profilerd MailRunIni "MailRun" "MailRunDir" MailRunDir
  152.     profilerd MailRunIni "MailRun" "AutoRun" AutoRun
  153.  
  154.     ;Save the current state of PCPlus/Win
  155.     fetch autodnld StateAutoDL
  156.     fetch capture path StateCapPath
  157.     fetch capture file StateCapFile
  158.     fetch dnldpath StateDnldPath
  159.     fetch upldpath StateUpldPath
  160.     StateActionBar = $ACTIONBAR
  161.     StateMetaKeys = $METAKEYS
  162.     ;Save the system state in the cleanup file
  163.     cleanupfile = makefullname(TempDir, "CLEANUP.TMP")
  164.     profilewr CleanupFile "Cleanup" "StateAutoDL" StateAutoDL
  165.     profilewr CleanupFile "Cleanup" "StateCapPath" StateCapPath
  166.     profilewr CleanupFile "Cleanup" "StateCapFile" StateCapFile
  167.     profilewr CleanupFile "Cleanup" "StateDnldPath" StateDnldPath
  168.     profilewr CleanupFile "Cleanup" "StateUpldPath" StateupldPath
  169.     profilewr CleanupFile "Cleanup" "StateActionBar" StateActionBar
  170.     profilewr CleanupFile "Cleanup" "StateMetaKeys" StateMetaKeys
  171.  
  172.     ;Change the settings
  173.     set capture path MailRunDir
  174.     set capture query OFF
  175.     set autodnld OFF
  176.     set aspect rangechk OFF
  177.     metakeys OFF
  178.     actionbar OFF
  179.  
  180.     ;If the mailrun in MAILRUN.INI doesn't exist, create it
  181.     if NULLSTR MailRunTrunc
  182.         blank = 1
  183.     else
  184.         LastRun = makefullname(MailRunDir, MailRunTrunc)
  185.     endif
  186.     if !(checkfile(LastRun)) || blank
  187.         temp = makefullname(MailRunDir, "*.MRN")
  188.         findfirst temp
  189.         if FOUND
  190.             MailRunTrunc = $FILENAME
  191.             LastRun = makefullname(MailRunDir, MailRunTrunc)
  192.         else
  193.             MailRunTrunc = "mailrun.mrn"
  194.             MailRunList = "mailrun.mrn"
  195.             makemrn()
  196.             LastRun = MailRun
  197.         endif
  198.     endif
  199.     ;Copy the mailrun to the temp directory
  200.     MailRun = makefullname(TempDir, MailRunTrunc)
  201.     TaskList = makefullname(TempDir, "TASKLIST.TMP")
  202.     copyfile LastRun MailRun
  203.     profilerd MailRun "MailRun" "Archiver" Archiver
  204.     profilerd MailRun "MailRun" "QWKReader" QWKReader
  205.     profilerd MailRun "MailRun" "LogViewer" LogViewer
  206. endproc
  207.  
  208.  
  209. #comment
  210. *********************************************************************
  211. * EXECUTOR()
  212. * Called by main()
  213. * Calls schedulebox(), mailrunbox(), checktime(), fileexit(),
  214. * scheduler(), domailrun(), makefullname(), filereset(),
  215. * maketasklist()
  216. * Executes MRUN211G
  217. * Puts up the MailRun Scheduling box and parses the result.
  218. *********************************************************************
  219. #endcomment
  220.  
  221. proc executor
  222. string HH, MM, SS, temp, LogFile, domailrun
  223. integer Hour, Minute, Second
  224. integer dialogstatus, boxstatus
  225.     domailrun = makefullname(MailRunDir, "MRUN211G")
  226.     findfirst MailRun
  227.     LogFile = $FNAME
  228.     strcat LogFile ".CAP"
  229.     if AppendLog == 0
  230.         ;if user does not want to append to existing log file
  231.         temp = makefullname(MailRunDir, LogFile)
  232.         delfile temp
  233.     endif
  234.     set capture file LogFile
  235.     profilerd MailRun "MailRun" "RingInterrupt" RingInterrupt
  236.     if AutoRun == 0
  237.         profilerd MailRun "MailRun" "ExecTime" ExecTime
  238.         profilerd MailRun "MailRun" "PostRun" PostRun
  239.         profilerd MailRun "MailRun" "GoWait" GoWait
  240.         schedulebox()
  241.         if GoWait == 1 
  242.             disable CTRL 230
  243.         endif
  244.     endif
  245.     ;boxstatus indicates whether or not mailrunbox is showing
  246.     boxstatus = 0
  247.     ;turn off parsedialog() for parsing contols
  248.     clearwhen dialog
  249.     while (FLAGS & RUNNING) && (AutoRun == 0)
  250.         dialogstatus = $DIALOG
  251.         switch dialogstatus
  252.             case 1
  253.                 ;User selected "Cancel"
  254.                 FLAGS &= IDLE
  255.                 mailrunbox()
  256.                 boxstatus = 1
  257.                 ;turn back on parsedialog() for parsing controls
  258.                 when dialog call parsedialog
  259.                 return
  260.             endcase
  261.             case 10
  262.                 ;User selected "OK"
  263.                 if GoWait == 2
  264.                     ;if the scheduler is turned on...
  265.                     ;parse the entered time
  266.                     strextract HH ExecTime ":" 0
  267.                     strextract MM ExecTime ":" 1
  268.                     strextract SS ExecTime ":" 2
  269.                     Hour = checktime(HH)
  270.                     Minute = checktime(MM)
  271.                     Second = checktime(SS)
  272.                     if ((Hour < 0) || (Hour > 23)) || ((Minute < 0) || \
  273.                         (Minute > 59)) || ((Second < 0) || (Second > 59))
  274.                         usermsg "The time must be in 24 hour format!"
  275.                         ExecTime = "HH:MM:SS"
  276.                         updatedlg 128
  277.                         dialogstatus = $DIALOG
  278.                         loopwhile
  279.                     endif
  280.                     profilewr MailRun "MailRun" "ExecTime" ExecTime
  281.                 endif
  282.                 profilewr MailRun "MailRun" "RingInterrupt" RingInterrupt
  283.                 profilewr MailRun "MailRun" "PostRun" PostRun
  284.                 profilewr MailRun "MailRun" "GoWait" GoWait
  285.                 exitwhile
  286.             endcase
  287.             case 50
  288.                 ;User changed Now/Later status
  289.                 if GoWait == 2
  290.                     enable CTRL 230
  291.                 else
  292.                     disable CTRL 230
  293.                 endif
  294.             endcase
  295.         endswitch
  296.     endwhile
  297.     while FLAGS & RUNNING
  298.         if AutoRun == 1
  299.             profilewr MailRunIni "MailRun" "AutoRun" 0
  300.         endif
  301.         if GoWait == 2
  302.             ;if user has scheduled for a later time...
  303.             mailrunbox()
  304.             boxstatus = 1
  305.             disable CTRL 170
  306.             when dialog call parsedialog
  307.             scheduler()
  308.         endif
  309.         if FLAGS & RUNNING
  310.             ;if the user has not terminated the mailrun, execute it
  311.             execute domailrun
  312.             boxstatus = 0
  313.             if PostRun == 2
  314.                 ;if post-mailrun activity is "Restart", reset the mailrun
  315.                 filereset()
  316.             elseif PostRun == 3
  317.                 ;if post-mailrun activity is "Shut Down", do so
  318.                 fileexit()
  319.             else
  320.                 ;if post-mailrun activity is "Remain Idle", reset RUNNING flag
  321.                 FLAGS &= IDLE
  322.             endif
  323.         endif
  324.     endwhile
  325.     if boxstatus == 0
  326.         ;if mailrunbox is not displayed, show it
  327.         mailrunbox()
  328.         when dialog call parsedialog
  329.     endif
  330.     if GoWait == 2
  331.         ;if the scheduler was used, enable the combobox
  332.         enable CTRL 170
  333.     endif
  334.     statmsg ""
  335.     maketasklist()
  336.     updatedlg 80
  337. endproc
  338.  
  339.  
  340. #comment
  341. *********************************************************************
  342. * SCHEDULER()
  343. * Called by executor()
  344. * Waits until the scheduled time before executing the
  345. * mailrun.
  346. *********************************************************************
  347. #endcomment
  348.  
  349. proc scheduler
  350. long LExecTime
  351.     updatedlg 64
  352.     ;get the system time for execution
  353.     strsltime $DATE ExecTime LExecTime
  354.     if LExecTime <= $LTIME
  355.         ;if the time of execution is earlier than the current time
  356.         ;increment the time of execution by 24 hours.
  357.         LExecTime += 86400
  358.     endif
  359.     strupr MailRunTrunc
  360.     while (LExecTime > $LTIME) && (FLAGS & RUNNING)
  361.         ;wait until the designated time is reached
  362.         statmsg "%s will execute at %s       Current time is %s" \
  363.             MailRunTrunc ExecTime $TIME24
  364.         pause 1
  365.     endwhile
  366.     strlwr MailRunTrunc
  367. endproc
  368.  
  369.  
  370. #comment
  371. *********************************************************************
  372. * CHECKTIME()
  373. * Called by executor()
  374. * Converts a string into an integer time value.  Returns
  375. * a value of 60 if a non-numeric character is received.
  376. *********************************************************************
  377. #endcomment
  378.  
  379. func checktime : integer
  380. strparm TimeString
  381. integer TimeInteger
  382.     atoi TimeString TimeInteger
  383.     if TimeInteger == 0
  384.         if not strcmpi TimeString "00"
  385.             TimeInteger = 60
  386.         endif
  387.     endif
  388.     return TimeInteger
  389. endfunc
  390.  
  391.  
  392. #comment
  393. *********************************************************************
  394. * MRUNMENU()
  395. * Called by main()
  396. * Creates the MailRun menu bar.
  397. *********************************************************************
  398. #endcomment
  399.  
  400. proc mrunmenu
  401.     menubar MailRunMenu
  402.         menupopup MailRunMenu "&File" FileMenu
  403.             menuitem FileMenu 1 "&New"
  404.             menuitem FileMenu 2 "&Save"
  405.             menuitem FileMenu 3 "Save &As"
  406.             menuitem FileMenu SEPARATOR
  407.             menuitem FileMenu 4 "&Reset mailrun"
  408.             menuitem FileMenu 5 "&Delete mailrun"
  409.             menuitem FileMenu SEPARATOR
  410.             menuitem FileMenu 6 "&Create AutoRun"
  411.             menuitem FileMenu SEPARATOR
  412.             menuitem FileMenu 7 "E&xit"
  413.         menupopup MailRunMenu "&Edit" EditMenu
  414.             menuitem EditMenu 8 "Cu&t"
  415.             menuitem EditMenu 9 "&Copy"
  416.             menuitem EditMenu 10 "&Paste"
  417.             menuitem EditMenu SEPARATOR
  418.             menuitem EditMenu 11 "De&lete"
  419.         menupopup MailRunMenu "&Configure" ConfigMenu
  420.             menuitem ConfigMenu 12 "&Mailrun Settings"
  421.             menuitem ConfigMenu 13 "&BBS Settings"
  422.             menuitem ConfigMenu 14 "BBS &Prompts"
  423.             menuitem ConfigMenu 15 "BBS Mail &Door"
  424.             menupopup ConfigMenu "De&faults" DefaultsMenu
  425.                 menuitem DefaultsMenu 16 "&MailRun"
  426.                 menuitem DefaultsMenu 17 "&BBS"
  427.                 menuitem DefaultsMenu 18 "&Prompts"
  428.                 menuitem DefaultsMenu 19 "Mail &Door"
  429.         menupopup MailRunMenu "&Add" AddMenu
  430.             menuitem AddMenu 20 "&New BBS"
  431.             menuitem AddMenu 21 "&Get/Send Mail"
  432.             menuitem AddMenu 22 "&Upload File"
  433.             menuitem AddMenu 23 "&Download File"
  434.             menuitem AddMenu 24 "Send &Command"
  435.             menuitem AddMenu 25 "Execute &Script"
  436.         menupopup MailRunMenu "&Execute" ExecuteMenu
  437.             menuitem ExecuteMenu 26 "&Execute MailRun"
  438.              menuitem ExecuteMenu 27 "&QWK Reader"
  439.             menuitem ExecuteMenu 28 "&Archiver"
  440.             menuitem ExecuteMenu 29 "&View Log File"
  441.         menupopup MailRunMenu "&Help" HelpMenu
  442.             menuitem HelpMenu 30 "&Contents"
  443.             menuitem HelpMenu 31 "&On current window..."
  444.             menuitem HelpMenu SEPARATOR
  445.             menuitem HelpMenu 32 "&About MailRun"
  446. endproc
  447.  
  448.  
  449. #comment
  450. *********************************************************************
  451. * RUNMENU()
  452. * Called by main()
  453. * Creates the menu bar used while a mailrun is executing.
  454. *********************************************************************
  455. #endcomment
  456.  
  457. proc runmenu
  458.     menubar RunningMenu
  459.         menupopup RunningMenu "&File" FileMenu
  460.             menuitem FileMenu 1 "&New"
  461.             menuitem FileMenu 2 "&Save"
  462.             menuitem FileMenu 3 "Save &As"
  463.             menuitem FileMenu SEPARATOR
  464.             menuitem FileMenu 4 "&Reset mailrun"
  465.             menuitem FileMenu 5 "&Delete mailrun"
  466.             menuitem FileMenu SEPARATOR
  467.             menuitem FileMenu 6 "&Create AutoRun"
  468.             menuitem FileMenu SEPARATOR
  469.             menuitem FileMenu 7 "E&xit"
  470.         menupopup RunningMenu "&Edit" EditMenu
  471.             menuitem EditMenu 8 "Cu&t"
  472.             menuitem EditMenu 9 "&Copy"
  473.             menuitem EditMenu 10 "&Paste"
  474.             menuitem EditMenu SEPARATOR
  475.             menuitem EditMenu 11 "De&lete"
  476.         menupopup RunningMenu "&Configure" ConfigMenu
  477.             menuitem ConfigMenu 12 "&Mailrun Settings"
  478.             menuitem ConfigMenu 13 "&BBS Settings"
  479.             menuitem ConfigMenu 14 "BBS &Prompts"
  480.             menuitem ConfigMenu 15 "BBS Mail &Door"
  481.             menupopup ConfigMenu "De&faults" DefaultsMenu
  482.                 menuitem DefaultsMenu 16 "&MailRun"
  483.                 menuitem DefaultsMenu 17 "&BBS"
  484.                 menuitem DefaultsMenu 18 "&Prompts"
  485.                 menuitem DefaultsMenu 19 "Mail &Door"
  486.         menupopup RunningMenu "&Add" AddMenu
  487.             menuitem AddMenu 20 "&New BBS"
  488.             menuitem AddMenu 21 "&Get/Send Mail"
  489.             menuitem AddMenu 22 "&Upload File"
  490.             menuitem AddMenu 23 "&Download File"
  491.             menuitem AddMenu 24 "Send &Command"
  492.             menuitem AddMenu 25 "Execute &Script"
  493.         menupopup RunningMenu "&Execute" ExecuteMenu
  494.             menuitem ExecuteMenu 26 "T&erminate MailRun"
  495.              menuitem ExecuteMenu 27 "&QWK Reader"
  496.             menuitem ExecuteMenu 28 "&Archiver"
  497.             menuitem ExecuteMenu 29 "&View Log File"
  498.         menupopup RunningMenu "&Help" HelpMenu
  499.             menuitem HelpMenu 30 "&Contents"
  500.             menuitem HelpMenu 31 "&On current window..."
  501.             menuitem HelpMenu SEPARATOR
  502.             menuitem HelpMenu 32 "&About MailRun"
  503. endproc
  504.  
  505.  
  506. #comment
  507. *********************************************************************
  508. * MRUNWIN()
  509. * Called by main()
  510. * Calls makefullname()
  511. * Creates the MailRun icon bar.  The DLL containing the
  512. * icons is copied to the C: root directory because the
  513. * iconbutton function will not accept variables as file
  514. * names.  C:\ is used because it is fairly certain to exist.
  515. *********************************************************************
  516. #endcomment
  517.  
  518. proc mrunwin
  519. string MRunIcons
  520.     MRunIcons = makefullname(MailRunDir, "MRUNICON.DLL")
  521.     copyfile MRunIcons "C:\MRUNICON.DLL"
  522.     defuserwin TOP PIXELS 34 192 192 192 bitmap
  523.         switch $XPIXELS
  524.             case 1280
  525.                 iconbutton  1   25 0 "" "C:\MRUNICON.DLL"  0 userwin
  526.                 iconbutton  2  300 0 "" "C:\MRUNICON.DLL"  1 userwin
  527.                 iconbutton  3  575 0 "" "C:\MRUNICON.DLL"  2 userwin 
  528.                 iconbutton  4  850 0 "" "C:\MRUNICON.DLL"  3 userwin 
  529.                 iconbutton  5 1250 0 "" "C:\MRUNICON.DLL"  4 userwin
  530.                 iconbutton  6 1525 0 "" "C:\MRUNICON.DLL"  5 userwin
  531.                 iconbutton  7 1800 0 "" "C:\MRUNICON.DLL"  6 userwin
  532.                 iconbutton  8 2075 0 "" "C:\MRUNICON.DLL"  7 userwin
  533.                 iconbutton  9 2350 0 "" "C:\MRUNICON.DLL"  8 userwin 
  534.                 iconbutton 10 2625 0 "" "C:\MRUNICON.DLL"  9 userwin
  535.                 iconbutton 11 2900 0 "" "C:\MRUNICON.DLL" 10 userwin
  536.                 iconbutton 12 3300 0 "" "C:\MRUNICON.DLL" 11 userwin
  537.                 iconbutton 13 3575 0 "" "C:\MRUNICON.DLL" 12 userwin
  538.                 iconbutton 14 3850 0 "" "C:\MRUNICON.DLL" 13 userwin
  539.                 iconbutton 15 4250 0 "" "C:\MRUNICON.DLL" 14 userwin
  540.                 iconbutton 16 4650 0 "" "C:\MRUNICON.DLL" 15 userwin
  541.             endcase
  542.             case 1024
  543.                 iconbutton  1   30 0 "" "C:\MRUNICON.DLL"  0 userwin
  544.                 iconbutton  2  374 0 "" "C:\MRUNICON.DLL"  1 userwin
  545.                 iconbutton  3  718 0 "" "C:\MRUNICON.DLL"  2 userwin 
  546.                 iconbutton  4 1062 0 "" "C:\MRUNICON.DLL"  3 userwin 
  547.                 iconbutton  5 1562 0 "" "C:\MRUNICON.DLL"  4 userwin
  548.                 iconbutton  6 1906 0 "" "C:\MRUNICON.DLL"  5 userwin
  549.                 iconbutton  7 2250 0 "" "C:\MRUNICON.DLL"  6 userwin
  550.                 iconbutton  8 2594 0 "" "C:\MRUNICON.DLL"  7 userwin
  551.                 iconbutton  9 2938 0 "" "C:\MRUNICON.DLL"  8 userwin 
  552.                 iconbutton 10 3282 0 "" "C:\MRUNICON.DLL"  9 userwin
  553.                 iconbutton 11 3626 0 "" "C:\MRUNICON.DLL" 10 userwin
  554.                 iconbutton 12 4126 0 "" "C:\MRUNICON.DLL" 11 userwin
  555.                 iconbutton 13 4470 0 "" "C:\MRUNICON.DLL" 12 userwin
  556.                 iconbutton 14 4814 0 "" "C:\MRUNICON.DLL" 13 userwin
  557.                 iconbutton 15 5314 0 "" "C:\MRUNICON.DLL" 14 userwin
  558.                 iconbutton 16 5814 0 "" "C:\MRUNICON.DLL" 15 userwin
  559.             endcase
  560.             case 800
  561.                 iconbutton  1   40 0 "" "C:\MRUNICON.DLL"  0 userwin
  562.                 iconbutton  2  480 0 "" "C:\MRUNICON.DLL"  1 userwin
  563.                 iconbutton  3  920 0 "" "C:\MRUNICON.DLL"  2 userwin 
  564.                 iconbutton  4 1360 0 "" "C:\MRUNICON.DLL"  3 userwin
  565.                 iconbutton  5 2000 0 "" "C:\MRUNICON.DLL"  4 userwin
  566.                 iconbutton  6 2440 0 "" "C:\MRUNICON.DLL"  5 userwin
  567.                 iconbutton  7 2880 0 "" "C:\MRUNICON.DLL"  6 userwin
  568.                 iconbutton  8 3320 0 "" "C:\MRUNICON.DLL"  7 userwin
  569.                 iconbutton  9 3760 0 "" "C:\MRUNICON.DLL"  8 userwin 
  570.                 iconbutton 10 4200 0 "" "C:\MRUNICON.DLL"  9 userwin
  571.                 iconbutton 11 4640 0 "" "C:\MRUNICON.DLL" 10 userwin
  572.                 iconbutton 12 5280 0 "" "C:\MRUNICON.DLL" 11 userwin 
  573.                 iconbutton 13 5720 0 "" "C:\MRUNICON.DLL" 12 userwin 
  574.                 iconbutton 14 6160 0 "" "C:\MRUNICON.DLL" 13 userwin 
  575.                 iconbutton 15 6800 0 "" "C:\MRUNICON.DLL" 14 userwin 
  576.                 iconbutton 16 7440 0 "" "C:\MRUNICON.DLL" 15 userwin 
  577.             endcase
  578.             default
  579.                 iconbutton  1   50 0 "" "C:\MRUNICON.DLL"  0 userwin
  580.                 iconbutton  2  600 0 "" "C:\MRUNICON.DLL"  1 userwin
  581.                 iconbutton  3 1150 0 "" "C:\MRUNICON.DLL"  2 userwin
  582.                 iconbutton  4 1700 0 "" "C:\MRUNICON.DLL"  3 userwin
  583.                 iconbutton  5 2500 0 "" "C:\MRUNICON.DLL"  4 userwin
  584.                 iconbutton  6 3050 0 "" "C:\MRUNICON.DLL"  5 userwin 
  585.                 iconbutton  7 3600 0 "" "C:\MRUNICON.DLL"  6 userwin 
  586.                 iconbutton  8 4150 0 "" "C:\MRUNICON.DLL"  7 userwin 
  587.                 iconbutton  9 4700 0 "" "C:\MRUNICON.DLL"  8 userwin 
  588.                 iconbutton 10 5250 0 "" "C:\MRUNICON.DLL"  9 userwin
  589.                 iconbutton 11 5800 0 "" "C:\MRUNICON.DLL" 10 userwin
  590.                 iconbutton 12 6600 0 "" "C:\MRUNICON.DLL" 11 userwin 
  591.                 iconbutton 13 7150 0 "" "C:\MRUNICON.DLL" 12 userwin
  592.                 iconbutton 14 7700 0 "" "C:\MRUNICON.DLL" 13 userwin 
  593.                 iconbutton 15 8500 0 "" "C:\MRUNICON.DLL" 14 userwin 
  594.                 iconbutton 16 9300 0 "" "C:\MRUNICON.DLL" 15 userwin
  595.             endcase
  596.         endswitch
  597.     paint
  598.     delfile "C:\MRUNICON.DLL"
  599. endproc
  600.  
  601.  
  602. #comment
  603. *********************************************************************
  604. * MAILRUNBOX()
  605. * Called by main(), parsedialog(), callscript(), executor(),
  606. * sendscript()
  607. * Draws the main MailRun dialog box.
  608. *********************************************************************
  609. #endcomment
  610.  
  611. proc mailrunbox
  612. destroydlg
  613. MainBoxTabs = "20,30,220,230,233,236,239,242"
  614. AttemptNum = "0"
  615. HelpPage = 1
  616. dialogbox 8 36 346 181 15 "MailRun" HELPID HelpPage
  617.    groupbox 10 33 228 135 "Task List" shadow
  618.    flistbox 15 52 218 102 TaskList MainBoxTabs single TaskItem
  619.    text  15 153 49 8 left "# = permanent"
  620.    text  76 153 49 8 left "ñ = temporary"
  621.    text  140 153 33 8 left "! = error"
  622.    text  182 153 53 8 left "@ = completed"
  623.    groupbox 244 33 90 135 "Statistics" shadow
  624.    text  248 55 62 8 right "BBSs in mailrun:"
  625.    text  248 69 62 8 right "BBSs completed:"
  626.    text  248 83 62 8 right "BBSs left to call:"
  627.    text  248 97 62 8 right "Items in mailrun:"
  628.    text  248 111 62 8 right "Items completed:"
  629.    text  248 125 62 8 right "Item errors:"
  630.    text  248 139 62 8 right "Items remaining:"
  631.    text  248 153 62 8 right "Dialing Attempt:"
  632.    vtext 314 55 16 9 left BBSTotal
  633.    vtext 314 69 16 9 left BBSComplete
  634.    vtext 314 83 16 9 left BBSRemaining
  635.    vtext 314 97 16 9 left ItemTotal
  636.    vtext 314 111 16 9 left ItemComplete
  637.    vtext 314 125 16 9 left ItemError
  638.    vtext 314 139 16 9 left ItemRemaining
  639.    vtext 314 153 16 9 left AttemptNum
  640.    text  102 14 74 8 right "The current mailrun is:"
  641.    combobox 180 12 76 41 MailRunList MailRunTrunc sort
  642.    pushbutton 0 0 0 0 "          &t" normal default
  643.    pushbutton 0 0 0 0 "          &u" normal
  644.    pushbutton 0 0 0 0 "          &i" normal
  645. enddialog
  646. if FLAGS & RUNNING
  647.     disable CTRL 170
  648. endif
  649. endproc
  650.  
  651.  
  652. #comment
  653. *********************************************************************
  654. * SCHEDULEBOX()
  655. * Called by executor()
  656. * Draws the MailRun Scheduler dialog box.
  657. *********************************************************************
  658. #endcomment
  659.  
  660. proc schedulebox
  661. destroydlg
  662. HelpPage = 3
  663. dialogbox 55 58 238 120 15 "MailRun Scheduler" HELPID HelpPage
  664.    groupbox 10 14 122 67 "Schedule" shadow
  665.    radiobutton 21 28 90 10 "Execute MailRun Now!" GoWait
  666.    radiobutton 21 44 90 10 "Execute MailRun Later..." endgroup
  667.    text  17 62 43 8 right "Execute At:"
  668.    editbox 64 60 55 12 ExecTime 8
  669.    groupbox 142 14 80 67 "When finished... " shadow
  670.    radiobutton 152 28 60 10 "Remain Idle" PostRun
  671.    radiobutton 152 44 60 10 "Restart" 
  672.    radiobutton 152 60 60 10 "Shut Down" endgroup
  673.    checkbox 10 92 116 12 "Interrupt mailrun if phone rings" RingInterrupt
  674.    pushbutton 132 93 40 14 "&OK" normal default
  675.    pushbutton 182 93 40 14 "&Cancel" cancel
  676. enddialog
  677. endproc
  678.  
  679.  
  680.